<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
    <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" media="all" />
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all" />
    <link href="css/chromagallery.css" rel="stylesheet" type="text/css" media="all" />
    <link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
    <link href="css/owner.css" rel="stylesheet" type="text/css" media="all" />
    <title>个人中心</title>
</head>

<body>
    <?php 
    require_once("./system/loginCheck.php");
    require_once("../congfig/config.php");
    $uid=$_SESSION['loginflag'];
    $username=$_SESSION['username'];
    $sql="select * from puser where uid=$uid";
    $result=$conn->query($sql);
    
     ?>
    <div class="navbar-wrapper">
        <div class="container">
            <nav class="navbar navbar-inverse navbar-static-top cl-effect-21">
                <div class="container">
                    <div id="navbar" class="navbar-collapse collapse">
                        <ul class="nav navbar-nav">
                            <li><a href="../index.php">首页</a></li>
                            <li><a href="../project-center.php">项目中心</a></li>
                            <li><a href="../project-teacher.php">指导教师</a></li>
                            <li><a href="#About Us">关于我们</a></li>
                            <li><a href="#" style="font-size:13px;margin-left: 100px;">个人中心</a></li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
        <div class="templatemo-flex-row">
            <div class="templatemo-sidebar">
                <nav class="templatemo-left-nav">
                    <ul>
                        <h4 id="uname"><?php echo $username; ?></h4>
                        <li><a href="owner-myProject.php"><i class="fa fa-bars fa-fw"></i>我的项目</a> </li>
                        <li><a href="owner-clareProject.php" class="active"><i class="fa fa-fire fa-fw"></i>发布项目</a></li>
                        <li><a href="owner-editInfor.php"><i class=" fa fa-user fa-fw"></i>修改信息</a></li>
                        <li><a href="owner-changePass.php"><i class="fa fa-cog fa-fw"></i>修改密码</a></li>
                        <li><a href="../loginout.php"><i class="fa fa-map-marker fa-fw"></i>注销</a></li>
                    </ul>
                </nav>
            </div>
            <div class="templatemo-content col-1 light-gray-bg" style="height:1000px;">
                <div class="container" id="msg">
                    <div class="tab-pane" role="tabpanel">
                        <table class="table ">
                            <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>项目名称</th>
                                    <th>项目负责人</th>
                                    <th>指导教师</th>
                                    <th>操作</th>
                                    <th>项目状态</th>
                                </tr>
                            </thead>
                            <?php 
                            $i=1;
                            while($row=$result->fetch_array()){
                                $id=$row['pid'];
                                $sql1="select * from proinfor where id=$id";
                                $result1=$conn->query($sql1);
                                $row1=$result1->fetch_array();
                             ?>
                            
                            <tbody>
                                <tr>
                                    <td id="project-id"><?php echo $i++; ?></td>
                                    <td><?php echo $row1["pName"]; ?></td>
                                    <td><?php echo $row1["pChar"]; ?></td>
                                    <td><?php echo $row1["teacher"]; ?></td>
                                    <td>
                                        <a class="btn btn-success btn-xs" href="project-content.php?pid=<?php echo $row1["id"] ?>" target="_block">查看</a>
                                    </td>
                                    <td><div class="btn btn-success btn-xs"><?php if ($row1["pRank"]==0) {
                        echo "申请立项";
                    }
                    elseif ($row1["pRank"]==1) {
                        echo "立项成功";
                    }
                    elseif ($row1["pRank"]==2) {
                        echo "立项失败";
                    }
                    elseif ($row1["pRank"]==3) {
                        echo "申请结项";
                    }
                    elseif ($row1["pRank"]==4) {
                        echo "结项成功";
                    }
                    elseif ($row1["pRank"]==5) {
                        echo "结项失败";
                    }
                    elseif ($row1["pRank"]==6) {
                        echo "逾期项目";
                    } ?></div></td>
                                </tr>
                            </tbody>
                            <?php 
                        }//end of while
                             ?>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <?php 
               if (isset($_GET["text"])) {
                  $text=$_GET["text"];
                  echo "<script>alert('$text')</script>";
               } ?>
        <!-- 底部兰 -->
        <section class="footer" id="About Us" style="margin-top:200px;width: 100%;">
            <h2 class="text-center">THANKS FOR VISITING US</h2>
            <hr>
            <div class="container">
                <div class="row">
                    <div class="col-md-4  col-md-offset-4">
                        <div class="contact-info">
                            <div class="phone">
                                <i class="glyphicon glyphicon-phone-alt"></i>
                                <p class="p4">+00 1010101010</p>
                            </div>
                            <div class="email-info">
                                <i class="glyphicon glyphicon-envelope"></i>
                                <p class="p4">469902XXX@qq.com </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <hr>
            <div class="copyright">
                <p>Copyright &copy; 2018.徐志摩 </p>
            </div>
        </section>
        <!-- 底部兰 end-->
    </div>
</body>

</html>